<layout name="layout:layout"/>

<!-- 内容主体区域 -->
<div id="content">
    <div class="layui-card layui-comment">
        <!-- // 默认操作按钮 -->
        <div class="layui-card-header layadmin-card-header-auto ">
            <div class="layui-form">
                <div class="layui-form-item">

                    <div class="layui-inline">
                        <div class="layui-input-inline ">
                            <input name="keyword" class="layui-input" type="text"
                                   placeholder="{:__('关键字搜索')}"/></div>
                    </div>

                    <div class="layui-inline">
                        <!-- // 默认搜索 -->
                        <button class="layui-btn icon-btn layui-btn-normal layui-btn-sm" lay-filter="formSearch"
                                lay-submit><i
                                class="layui-icon layui-icon-search"></i>{:__('搜索')}
                        </button>
                    </div>
                </div>
            </div>
        </div>

        <!-- // 创建数据实例 -->
        <table id="lay-tableList" lay-filter="lay-tableList"></table>
    </div>
</div>

<!-- // 列表工具栏 -->
<script type="text/html" id="tableBar">
    <a class="layui-table-text" lay-open data-title="{:__('编辑评论')}" data-area="650px,395px"
       data-url="/user/commentedit?id={{d.id}}" >{:__('编辑')}</a>
    <div class="layui-divider layui-divider-vertical"></div>
    <a class="layui-table-text" onClick="layer.msg('暂不支持删除','info')">{:__('删除')}</a>
</script>

<script>
    layui.use(['table'], function () {

        var table = layui.table;
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList"
            , url: "{:url('/user/comment')}"
            , page: true
            , limit: 18
            , cols: [[
                {type: 'checkbox', width: 45},
                {field: 'content', align: 'left', title: '{:__("评论内容")}'},
                {field: 'count', align: 'center', width: 120, title: '{:__("回复")}'},
                {field: 'ip', align: 'center', width: 160, title: '{:__("登录IP")}'},
                {field: 'create_time', align: 'center', width: 160, title: '{:__("评论时间")}'},
                {align: 'center', toolbar: '#tableBar', width: 160, title: '{:__("操作")}'},
            ]]
        })


    })
</script>